package wqh.pojo;

import wqh.domain.SystemLog;
import wqh.service.SystemLogService;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * Created by devts on 2016/9/27.
 */
public class xkLog {

    private static final String DEVICE_CONTROLLER = "用户信息传输装置管理";
    private static final String MAP_CONFIGURE = "地理信息配置";
    private static final String SENSOR_CONFIGURE = "传感器配置";
    private static final String MONITOR_CONFIGURE = "监测点配置";
    private static final String LOG_CONFIG = "日志处理";
    private static final String ALARM_CONFIG = "报警处理";
    private static final String FILE_CONFIG = "文件处理";

    public static List<String> getLogType()
    {
        List<String> list = new ArrayList<String>();
        list.add(ALARM_CONFIG);
        list.add(DEVICE_CONTROLLER);
        list.add(MAP_CONFIGURE);
        list.add(SENSOR_CONFIGURE);
        list.add(MONITOR_CONFIGURE);
        list.add(LOG_CONFIG);
        list.add(FILE_CONFIG);
        return list;
    }


    public static void addLog(SystemLogService systemLogService,String log_detail, String log_type, String user)
    {
        Date date = new Date();
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String log_time_str = dateFormat.format(date);
        SystemLog systemLog = new SystemLog(log_time_str,log_detail,log_type, user);
        systemLogService.insertRecordSample(systemLog);
    }

    public static String getFileConfig() {
        return FILE_CONFIG;
    }

    public static String getDeviceController() {
        return DEVICE_CONTROLLER;
    }

    public static String getMapConfigure() {
        return MAP_CONFIGURE;
    }

    public static String getSensorConfigure() {
        return SENSOR_CONFIGURE;
    }

    public static String getMonitorConfigure() {
        return MONITOR_CONFIGURE;
    }

    public static String getLogConfig() {
        return LOG_CONFIG;
    }

    public static String getAlarmConfig() {
        return ALARM_CONFIG;
    }
}
